TUTORIAL NINE
Adding Shine
Shine is the fine layer of detail that turns a good game into a great game. Shine is why you like the latest model of car, stereo and washing machine. ItÆs the six coats of polish you pay for through the nose.
/Help/tutorials/gfx/tutorial9.jpg)
We could add shine forever. For this tutorial we shall add just two coats of shine. Some statistical shine and particle bullet shine. For our stats, we shall inform the user how many aliens remain in the level, when the level is complete and how far away the player is to the nearest alien. The function below does all this:
rem TUT9A
rem Distance to next alien
if aliensleft>0 then text 20,screen height()-40,"DISTANCE READING:"+str$(abs(cdist#*100))
rem Aliens Left Stat
s$=str$(aliensleft)+" ALIENS LEFT"
if aliensleft=0 then s$="LEVEL COMPLETE!" : stop sound EnemySnd
text 640-20-text width(s$),screen height()-40,s$
To add our particle bullet shine, we simply have to create and control a particles object and use the position of the bullet object as our guide. There are three areas of code we must modify. The creation, control and destruction of the bullet.
Bullet creation:
rem TUT9B
if particles exist(1)=1 then delete particles 1
make particles 1, FireImg, 50, 0.5
set particle emissions 1,10
set particle speed 1,0.01
Bullet control:
rem TUT9C
rem Update particle using bullet object position
set particle emissions 1,1+(bullet/10)
rotate particles 1,90-object angle x(BulletObj),object angle y(BulletObj)+180,0
position particles 1,object position x(BulletObj),object position y(BulletObj),object position z(BulletObj)
Bullet destruction:
rem TUT9D
set particle emissions 1,0
CLICK HERE TO RETURN TO THE MAIN MENU